package bean.Being;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试Spring使用静态工厂方法创建bean实例
 * 测试类
 */
public class TestBeing {
    public static ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
    public static void main(String[] args) {
        testInit();
    }
    public static void testInit(){
        Being dog = ctx.getBean("dog",Being.class);
        Being cat = ctx.getBean("cat",Being.class);
        Being bigDog = ctx.getBean("bigDog",Being.class);
        dog.testBeing();
        cat.testBeing();
        bigDog.testBeing();
    }
}
